import os

from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument,ExecuteProcess
from launch.actions import IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution,PythonExpression

from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare   

def generate_launch_description():
    #执行 MicroXRCEAgent udp4 -p 8888
    microagent = ExecuteProcess(
        cmd=['MicroXRCEAgent', 'udp4', '-p', '8888'],  # 要运行的命令和参数
        output='screen'  # 将输出打印到终端
    )

 

    return LaunchDescription([
        microagent,
    ])
